<template>
  <div>
    <h1 class="title">你好啊</h1>
    <School :get-school-name="getSchoolName"/>
<!--    自定义事件-->
    <Student @atguigu="getStudentName"/>
<!--    自带事件需要加.native-->
<!--    <Student @click.n.native="getStudentName"/>-->
  </div>
</template>

<script>
import Student from './components/Student'
import School from './components/School'

export default {
  name: 'App',
  components: {School, Student},
  methods: {
    getSchoolName(name) {
      console.log(name);
    },
    getStudentName(name){
      console.log(name)
    }
  },
}
</script>

<style scoped>
.title {
  color: red;
}
</style>
